﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows;

#if !SILVERLIGHT
namespace UIT.WPF.Converters
#else
namespace UIT.Silverlight.Converters
#endif
{
    class ThicknessConverter : IValueConverter
    {
        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            UIT.Style.Thickness? thicknessValue = value as UIT.Style.Thickness?;
            if (thicknessValue.HasValue)
                return new Thickness(thicknessValue.Value.Left.Value, thicknessValue.Value.Top.Value, thicknessValue.Value.Right.Value, thicknessValue.Value.Bottom.Value);
            return null;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
